package masterjava.common.client.gxt.base;

import masterjava.common.client.gwt.rpc.CallbackAdapter;
import masterjava.common.client.gwt.settings.AppSettings;
import masterjava.common.shared.settings.SettingsResponse;

/**
 * User: gkislin
 * Date: 7/21/11
 */
abstract public class ConfigEntryPoint extends BaseEntryPoint {

    @Override
    protected void load(final RootLayout rootLayout) {
        AppSettings.send(new CallbackAdapter<SettingsResponse>() {
            @Override
            protected void process(SettingsResponse result) {
                AppSettings.setSettings(result.getSettings());
                doLoad(rootLayout);
                rootLayout.setAppDetails();
                rootLayout.layout();
            }
        });
    }

    protected abstract void doLoad(RootLayout rootLayout);
}
